<?php
class Application_Model_Menu implements Iterator {
	protected $_pages;
	protected $_active;
	
	public function __construct(array $pages) {
		$this->_pages = $pages;
	}
	
	public function addPage($key, array $value) {
		$this->_pages [$key] = $value;
	}
	
	public function setActive($val) {
		$this->_active = $val;
	}
	
	public function getActive() {
		return $this->_active;
	}
	
	public function current() {
		return current ( $this->_pages );
	}
	
	public function next() {
		next ( $this->_pages );
	}
	
	public function key() {
		return key ( $this->_pages );
	}
	
	public function valid() {
		return current ( $this->_pages ) !== false;
	}
	
	public function rewind() {
		reset ( $this->_pages );
	}
}